// webpack.renderer.config.js
const path = require('path');
const { VueLoaderPlugin } = require('vue-loader');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const rules = require('./webpack.rules');

module.exports = {
  module: {
    rules
  },
  resolve: {
    extensions: ['.js', '.vue', '.json'],
    alias: {
      '@': path.resolve(__dirname, 'src'),
    },
  },

  plugins: [
    new VueLoaderPlugin(),
   // ✅ login 窗口
   new HtmlWebpackPlugin({
    filename: 'login_window.html',
    template: path.resolve(__dirname, 'src/login_window.html'),
    chunks: ['login_window'],
    inject: 'body',
    title: 'Login',
  }),

  // ✅ register 窗口
  new HtmlWebpackPlugin({
    filename: 'register_window.html',
    template: path.resolve(__dirname, 'src/register_window.html'),
    chunks: ['register_window'],
    inject: 'body',
    title: 'Register',
  }),

  // ✅ main 窗口
  new HtmlWebpackPlugin({
    filename: 'main_window.html',
    template: path.resolve(__dirname, 'src/main_window.html'),
    chunks: ['main_window'],
    inject: 'body',
    title: 'Main',
  }),

  // ✅ video 窗口
  new HtmlWebpackPlugin({
    filename: 'video_window.html',
    template: path.resolve(__dirname, 'src/video_window.html'),
    chunks: ['video_window'],
    inject: 'body',
    title: 'video',
  }),
  new HtmlWebpackPlugin({
    filename: 'addFriend_window.html',
    template: path.resolve(__dirname, 'src/addFriend_window.html'),
    chunks: ['addFriend_window'],
    inject: 'body',
    title: 'addFriend',
  }),
  ],
  
};
